# coding: utf-8
from . import db, BaseModel


class QuestionAnswer(db.Model):
    __tablename__ = 'question_answer'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    qa_id = db.Column(db.BigInteger, nullable=False, info='提问或回答id')
    qa_parent_id = db.Column(db.BigInteger, info='上级id')
    qaer_id = db.Column(db.BigInteger, nullable=False, info='提问或回答者id')
    title = db.Column(db.String(255, 'utf8mb4_general_ci'), nullable=False, info='问题标题')
    content = db.Column(db.Text(collation='utf8mb4_0900_ai_ci'), nullable=False, info='内容')
    qa_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='问答时间')
    likess = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='点赞量')
    is_delete = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='逻辑删除')
    create_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='更新时间')
